Reshaping a camera image

ABSTRACT

Apparatuses, computer media, and methods for altering a camera image, in which the source image may be angularly displaced from a camera image. A plurality of points on the camera image is located and a mesh is generated. Compensation information based on the displacement is determined, and a reshaped image is rendered from the mesh, the compensation information, and the camera image. The camera image is reshaped by relocating a proper subset of the points on the camera image. Deformation vectors are applied to corresponding points on the mesh using the compensation information. A correction factor is obtained from an angular displacement and a translation displacement of the source image from the camera image. The deformation factor is multiplied by the compensation factor to form a deformation vector to compensate for angular and translational displacements of the source image from the camera image.

This application is a continuation-in-part of co-pending U.S. patentapplication Ser. No. 11/625,937 entitled “Reshaping an Image to Thin orFatten a Face” and filed on Jan. 23, 2007, the entire disclosure ofwhich is hereby incorporated by reference.

FIELD OF THE INVENTION

This invention relates to altering a camera image. More particularly,the invention applies to a source image being angularly displaced fromthe camera image plane.

BACKGROUND OF THE INVENTION

Excessive body weight is a major cause of many medical illnesses. Withtoday's life style, people are typically exercising less and eatingmore. Needless to say, this life style is not conducive to good health.For example, it is acknowledged that type-2 diabetes is trending toepidemic proportions. Obesity appears to be a major contributor to thistrend.

On the other hand, a smaller proportion of the population experiencesfrom being underweight. However, the effects of being underweight may beeven more divesting to the person than to another person beingoverweight. In numerous related cases, people eat too little as a resultof a self-perception problem. Anorexia is one affliction that is oftenassociated with being grossly underweight.

While being overweight or underweight may have organic causes, oftensuch afflictions are the result of psychological issues. If one canobjectively view the effect of being underweight or underweight, one maybe motivated to change one's life style, e.g., eating in a healthierfashion or exercising more. Viewing a predicted image of one's body ifone continues one's current life style may motivate the person to livein a healthier manner.

BRIEF SUMMARY OF THE INVENTION

Embodiments of invention provide apparatuses, computer media, andmethods for altering a camera image, in which the source image may beangularly displaced from a camera image.

With an aspect of the invention, a plurality of points on the cameraimage is located and a mesh is generated. The mesh is superimposed onthe camera image and associated with corresponding texture informationof the camera image. Compensation information based on the displacementis determined, and a reshaped image is rendered from the mesh, thecompensation information, and the camera image.

With another aspect of the invention, the camera image is reshaped byrelocating a proper subset of the points on the camera image.Deformation vectors are applied to corresponding points on the meshusing the compensation information. A deformation vector may comprise aproduct of factors, including a weight value factor (A), a scale factor(s), a deformation factor (w), and a direction vector ({right arrow over(u)}).

With another aspect of the invention, a correction factor is obtainedfrom an angular displacement and a translation displacement of thesource image from the camera image. The deformation factor is multipliedby the compensation factor to form a deformation vector to compensatefor angular and translational displacements of the source image from thecamera image.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention is illustrated by way of example and not limitedin the accompanying figures in which like reference numerals indicatesimilar elements and in which:

FIG. 1 shows a mesh that is superimposed in a face image in accordancewith an embodiment of the image.

FIG. 2 shows a set of points for altering a face image in accordancewith an embodiment of the invention.

FIG. 3 shows controlling points for face alteration in accordance withan embodiment of the invention.

FIG. 4 shows visual results for altering a face image in accordance withan embodiment of the invention.

FIG. 5 shows additional visual results for altering a face image inaccordance with an embodiment of the invention.

FIG. 6 shows additional visual results for altering a face image inaccordance with an embodiment of the invention.

FIG. 7 shows additional visual results for altering a face image inaccordance with an embodiment of the invention.

FIG. 8 shows a flow diagram for altering a face image in accordance withan embodiment of the invention.

FIG. 9 shows an architecture of a computer system used in altering aface image in accordance with an embodiment of the invention.

FIG. 10 shows a schema of a reference system and camera model for anadaptive process for processing an image in accordance with anembodiment of the invention.

DETAILED DESCRIPTION OF THE INVENTION

FIG. 1 shows a mesh that is superimposed in a face image in accordancewith an embodiment of the image. As will be discussed, an algorithmfattens or thins the face image in accordance with an embodiment of theinvention. Points along the face, neck, and image boundary aredetermined in order to form the mesh. As will be further discussed, thealgorithm alters the facial contour and then reshapes the area aroundthe neck. (Points 136-145 will be discussed in a later discussion.) Thealtered image is rendered by using the points as vertices of the mesh.

This mesh is associated to its corresponding texture from the picturewhere the alteration is taking place. The corners and four points alongeach side of the picture (as shown in FIG. 1) are also considered aspart of the mesh. Computer graphics software API (ApplicationProgramming Interface) is used to render the altered image (e.g., asshown in FIGS. 4-7). OpenGL API is an example of computer graphicssoftware that may be used to render the altered image.

FIG. 2 shows a set of points (including points 200, 206, 218, and 231which will be discussed in further detail) for altering a face image inaccordance with an embodiment of the invention. (Please note that FIG. 2shows a plurality of points, which correspond to the vertices of themesh.) Points 200, 206, 218, and 231 are only some of the plurality ofpoints. An embodiment of the invention uses the search function of asoftware technique called Active Appearance Model (AAM), which utilizesa trained model. (Information about AAM is available athttp://www2.imm.dtu.dk/˜aam and has been utilized by other researchers.)However, points 200, 206, 218, and 231 may be determined with otherapproaches, e.g., a manual process that is performed by medicalpractitioner manually entering the points. With an embodiment of theinvention, the trained model is an AMF file, which is obtained from thetraining process. For the training the AAM, a set of images with facesis needed. These images may belong to the same person or differentpeople. Training is typically dependent on the desired degree ofaccuracy and the degree of universality of the population that iscovered by the model. With an exemplary embodiment, one typicallyprocesses at least five images with the algorithm that is used. Duringthe training process, the mesh is manually deformed on each image. Onceall images are processed, the AAM algorithms are executed over the setof points and images, and a global texture/shape model is generated andstored in an AMF file. The AMF file permits an automatic search infuture images not belonging to the training set. With an exemplaryembodiment, one uses the AAM API to generate Appearance Model Files(AMF). Embodiments of the invention also support inputting the pluralityof points through an input device as entered by a user. A mesh issuperimposed on the image at points (e.g., the set of points shown inFIG. 2) as determined by the trained process.

FIG. 2 also shows the orientation of the x and y coordinates of thepoints as shown in FIGS. 1-3.

FIG. 3 shows controlling points 306-331 for face alteration inaccordance with an embodiment of the invention. (Points 306, 318, and331 correspond to points 206, 218, and 231 respectively as shown in FIG.2.) Points 306-331, which correspond to points around the cheeks andchin of the face, are relocated (transformed) for fattening or thinninga face image to a desired degree. With an embodiment of the invention,only a proper subset (points 306-331) of the plurality of points (asshown in FIG. 2) are relocated. (With a proper subset, only some, andnot all, of the plurality points are included.)

In the following discussion that describes the determination of thedeformation vectors for reshaping the face image, index i=6 to indexi=31 correspond to points 306 to points 331, respectively. Thedetermined deformation vectors are added to points 306 to points 331 tore-position the point, forming a transformed mesh. A reshaped image isconsequently rendered using the transformed mesh.

In accordance with embodiments of the invention, deformation vectorcorrespond to a product of four elements (factors):{right arrow over (v)} _(d) ={right arrow over (u)}·s·w·A  (EQ. 1)where A is the weight value factor, s is the scale factor, w is thedeformation factor, and {right arrow over (u)} is the direction vector.In accordance with an embodiment of the invention:

-   -   Weight value factor [A]: It determines the strength of the        thinning and fattening that we wan to apply.        A>0 fattening  (EQ. 2A)        A<0 thinning  (EQ. 2B)        A=0 no change  (EQ. 2C)    -   Scale factor [s]. It is the value of the width of the face        divided by B. One uses this factor to make this vector        calculation independent of the size of the head we are working        with. The value of B will influence how the refined is the scale        of the deformation. It will give the units to the weight value        that will be applied externally.

$\begin{matrix}{s = \frac{{x_{31} - x_{6}}}{B}} & \left( {{EQ}.\mspace{14mu} 3} \right)\end{matrix}$

-   -   Deformation factor [w]. It is calculated differently for        different parts of cheeks and chin. One uses a different        equation depending on which part of the face one is processing:

$\begin{matrix}\begin{matrix}{i \in \left\lbrack {6 - 13} \right\rbrack} & {\;{w_{i} = {{\frac{2}{3}\frac{1}{{x_{6} - x_{13}}}{{x_{i} - x_{C\; 1}}}} + \frac{1}{3}}}} \\{i \in \left\lbrack {14 - 18} \right\rbrack} & {w_{i} = {{{- \frac{1}{{{x_{13} - x_{18}}}^{2}}}{{x_{i} - x_{C\; 1}}}^{2}} + 1}} \\{i \in \left\lbrack {19 - 23} \right\rbrack} & {w_{i} = {{{- \frac{1}{{{x_{18} - x_{24}}}^{2}}}{{x_{i} - x_{C\; 1}}}^{2}} + 1}} \\{i \in \left\lbrack {24 - 31} \right\rbrack} & {w_{i} = {{\frac{2}{3}\frac{1}{{x_{24} - x_{31}}}{{x_{i} - x_{C\; 2}}}} + \frac{1}{3}}}\end{matrix} & \begin{matrix}\begin{matrix}\begin{matrix}\; \\\left( {{{EQ}.\mspace{14mu} 4}A} \right)\end{matrix} \\\;\end{matrix} \\\left( {{{EQ}.\mspace{14mu} 4}B} \right) \\\; \\\left( {{{EQ}.\mspace{14mu} 4}C} \right) \\\; \\\left( {{{EQ}.\mspace{14mu} 4}D} \right)\end{matrix}\end{matrix}$

-   -   Direction vector [{right arrow over (u)}]: It indicates the        sense of the deformation. One calculates the direction vector as        the ratio between: the difference (for each coordinate) between        the center and our point, and the absolute distance between this        center and our point. One uses two different centers in this        process: center C2 (point 253 as shown in FIG. 2) for the points        belonging to the jaw and center C1 (point 251 as shown in        FIG. 2) for the points belonging to the cheeks.

$\begin{matrix}{{{{{i \in \left\lbrack {6 - 13} \right\rbrack}\&}\left\lbrack {24 - 31} \right\rbrack}\mspace{50mu}{\overset{\rightarrow}{u}}_{i}} = \frac{x_{i} - x_{C\; 1}}{{x_{i} - x_{C\; 1}}}} & \left( {{{EQ}.\mspace{14mu} 5}A} \right) \\{{i \in {\left\lbrack {14 - 23} \right\rbrack\mspace{160mu}{\overset{\rightarrow}{u}}_{i}}} = \frac{x_{i} - x_{C\; 2}}{{x_{i} - x_{C\; 2}}}} & \left( {{{EQ}.\mspace{14mu} 5}B} \right)\end{matrix}$

Neck point-coordinates x_(i) are based on the lower part of the face,where

$\begin{matrix}{{i \in \left\lbrack {36 - 45} \right\rbrack}{j \in \left\lbrack {14 - 23} \right\rbrack}{x_{i} = \left( {x_{j},{y_{j} + {neck\_ height}}} \right)}} & \left( {{EQ}.\mspace{14mu} 6} \right) \\{{neck\_ height} = \frac{y_{18} - y_{0}}{6}} & \left( {{EQ}.\mspace{14mu} 7} \right)\end{matrix}$where y₁₈ and y₀ are the y-coordinates of points 218 and 200,respectively, as shown in FIG. 2. Referring back to FIG. 1, index i=36to i=45 correspond to points 136 to 145, respectively. Index j=14 toj=23 correspond to points 314 to 323, respectively, (as shown in FIG. 3)on the lower part of the face, from which points 136 to 145 on the neckare determined. (In an embodiment of the invention, points 136 to 145are determined from points 314 to 323 before points 314 to 323 arerelocated in accordance with EQs. 1-5.)

The deformation vector ({right arrow over (v)}_(d) _(—) _(neck)) appliedat points 136 to 145 has two components:

$\begin{matrix}{{\overset{\;\rightarrow}{v}}_{d\_ neck} = \left( {0,y_{d\_ neck}} \right)} & \left( {{EQ}.\mspace{14mu} 8} \right) \\{{{{when}\mspace{14mu} x_{i}} < x_{41}}{y_{{d\_ neck}_{t}} = {- \frac{\left( {x_{i} - x_{18}} \right)^{2}}{10 \cdot \left( \frac{x_{24} - x_{13}}{2} \right)^{2}}}}} & \left( {{{EQ}.\mspace{14mu} 9}A} \right) \\{{{{when}\mspace{14mu} x_{i}} \geq x_{41}}{y_{{d\_ neck}_{t}} = {- \frac{\left( {x_{i} - x_{18}} \right)^{2}}{10 \cdot \left( \frac{x_{24} - x_{13}}{2} \right)^{2}}}}} & \left( {{{EQ}.\mspace{14mu} 9}B} \right)\end{matrix}$

The Appendix provides exemplary software code that implements the abovealgorithm.

FIG. 4 shows visual results for altering a face image in accordance withan embodiment of the invention. Images 401 to 411 correspond to A=+100to A=+50, respectively, which correspond to decreasing degrees offattening.

With an embodiment of the invention, A=+100 corresponds to a maximumdegree of fattening and A=−100 corresponds to a maximum degree ofthinning. The value of A is selected to provide the desired degree offattening or thinning. For example, if a patient were afflictedanorexia, the value of A would have a negative value that would dependon the degree of affliction and on the medical history and body type ofthe patient. As another example, a patient may be over-eating or mayhave an unhealthy diet with many empty calories. In such a case, A wouldhave a positive value. A medical practitioner may be able to gauge thevalue of A based on experience. However, embodiments of invention maysupport an automated implementation for determining the value of A. Forexample, an expert system may incorporate knowledge based on informationprovided by experienced medical practitioners.

FIG. 5 shows additional visual results for altering a face image inaccordance with an embodiment of the invention. Images 501-511,corresponding to A=+40 to A=−10, show the continued reduced sequencingof the fattening. When A=0 (image 509), the face is shown as it reallyappears. With A=−10 (image 511), the face is shows thinning. As Abecomes more negative, the effects of thinning is increased.

FIG. 6 shows additional visual results for altering a face image inaccordance with an embodiment of the invention. Images 601-611 continuethe sequencing of images with increased thinning (i.e., A becoming morenegative).

FIG. 7 shows additional visual results for altering a face image inaccordance with an embodiment of the invention. Images 701-705 completethe sequencing of the images, in which the degree of thinning increases.

FIG. 8 shows flow diagram 800 for altering a face image in accordancewith an embodiment of the invention. In step 801, points are located onthe image of the face and neck in order form a mesh. Points may bedetermined by a trained process or may be entered through an inputdevice by a medical practitioner. In step 803, reshaping parameters(e.g., a weight value factor A) are obtained. The reshaping factors maybe entered by the medical practitioner or may be determined by a process(e.g. an expert system) from information about the person associatedwith the face image.

In step 805 deformation vectors are determined and applied to points(e.g. points 306-331 as shown in FIG. 3) on the face. For example, asdiscussed above, EQs. 1-5. are used to determine the relocated points.In step 807 deformation vectors are determined (e.g., using EQs. 6-9)and applied to points (e.g., points 136-145 as shown in FIG. 1) on theneck. A transformed mesh is generated from which a reshaped image isrendered using computer graphics software in step 809.

FIG. 9 shows computer system 1 that supports an alteration of a faceimage in accordance with an embodiment of the invention. Elements of thepresent invention may be implemented with computer systems, such as thesystem 1. Computer system 1 includes a central processor 10, a systemmemory 12 and a system bus 14 that couples various system componentsincluding the system memory 12 to the central processor unit 10. Systembus 14 may be any of several types of bus structures including a memorybus or memory controller, a peripheral bus, and a local bus using any ofa variety of bus architectures. The structure of system memory 12 iswell known to those skilled in the art and may include a basicinput/output system (BIOS) stored in a read only memory (ROM) and one ormore program modules such as operating systems, application programs andprogram data stored in random access memory (RAM).

Computer 1 may also include a variety of interface units and drives forreading and writing data. In particular, computer 1 includes a hard diskinterface 16 and a removable memory interface 20 respectively coupling ahard disk drive 18 and a removable memory drive 22 to system bus 14.Examples of removable memory drives include magnetic disk drives andoptical disk drives. The drives and their associated computer-readablemedia, such as a floppy disk 24 provide nonvolatile storage of computerreadable instructions, data structures, program modules and other datafor computer 1. A single hard disk drive 18 and a single removablememory drive 22 are shown for illustration purposes only and with theunderstanding that computer 1 may include several of such drives.Furthermore, computer 1 may include drives for interfacing with othertypes of computer readable media.

A user can interact with computer 1 with a variety of input devices.FIG. 7 shows a serial port interface 26 coupling a keyboard 28 and apointing device 30 to system bus 14. Pointing device 28 may beimplemented with a mouse, track ball, pen device, or similar device. Ofcourse one or more other input devices (not shown) such as a joystick,game pad, satellite dish, scanner, touch sensitive screen or the likemay be connected to computer 1.

Computer 1 may include additional interfaces for connecting devices tosystem bus 14. FIG. 7 shows a universal serial bus (USB) interface 32coupling a video or digital camera 34 to system bus 14. An IEEE 1394interface 36 may be used to couple additional devices to computer 1.Furthermore, interface 36 may configured to operate with particularmanufacture interfaces such as FireWire developed by Apple Computer andi.Link developed by Sony. Input devices may also be coupled to systembus 114 through a parallel port, a game port, a PCI board or any otherinterface used to couple and input device to a computer.

Computer 1 also includes a video adapter 40 coupling a display device 42to system bus 14. Display device 42 may include a cathode ray tube(CRT), liquid crystal display (LCD), field emission display (FED),plasma display or any other device that produces an image that isviewable by the user. Additional output devices, such as a printingdevice (not shown), may be connected to computer 1.

Sound can be recorded and reproduced with a microphone 44 and a speaker66. A sound card 48 may be used to couple microphone 44 and speaker 46to system bus 14. One skilled in the art will appreciate that the deviceconnections shown in FIG. 7 are for illustration purposes only and thatseveral of the peripheral devices could be coupled to system bus 14 viaalternative interfaces. For example, video camera 34 could be connectedto IEEE 1394 interface 36 and pointing device 30 could be connected toUSB interface 32.

Computer 1 can operate in a networked environment using logicalconnections to one or more remote computers or other devices, such as aserver, a router, a network personal computer, a peer device or othercommon network node, a wireless telephone or wireless personal digitalassistant. Computer 1 includes a network interface 50 that couplessystem bus 14 to a local area network (LAN) 52. Networking environmentsare commonplace in offices, enterprise-wide computer networks and homecomputer systems.

A wide area network (WAN) 54, such as the Internet, can also be accessedby computer 1. FIG. 7 shows a modem unit 56 connected to serial portinterface 26 and to WAN 54. Modem unit 56 may be located within orexternal to computer 1 and may be any type of conventional modem such asa cable modem or a satellite modem. LAN 52 may also be used to connectto WAN 54. FIG. 7 shows a router 58 that may connect LAN 52 to WAN 54 ina conventional manner.

It will be appreciated that the network connections shown are exemplaryand other ways of establishing a communications link between thecomputers can be used. The existence of any of various well-knownprotocols, such as TCP/IP, Frame Relay, Ethernet, FTP, HTTP and thelike, is presumed, and computer 1 can be operated in a client-serverconfiguration to permit a user to retrieve web pages from a web-basedserver. Furthermore, any of various conventional web browsers can beused to display and manipulate data on web pages.

The operation of computer 1 can be controlled by a variety of differentprogram modules. Examples of program modules are routines, programs,objects, components, and data structures that perform particular tasksor implement particular abstract data types. The present invention mayalso be practiced with other computer system configurations, includinghand-held devices, multiprocessor systems, microprocessor-based orprogrammable consumer electronics, network PCS, minicomputers, mainframecomputers, personal digital assistants and the like. Furthermore, theinvention may also be practiced in distributed computing environmentswhere tasks are performed by remote processing devices that are linkedthrough a communications network. In a distributed computingenvironment, program modules may be located in both local and remotememory storage devices.

In an embodiment of the invention, central processor unit 10 obtains aface image from digital camera 34. A user may view the face image ondisplay device 42 and enter points (e.g., points 206-231 as shown inFIG. 2) to form a mesh that is subsequently altered by central processor10 as discussed above. The user may identify the points with a pointerdevice (e.g. mouse 30) that is displayed on display device 42, whichoverlays the mesh over the face image. With embodiments of theinvention, a face image may be stored and retrieved from hard disk drive18 or removable memory drive 22 or obtained from an external server (notshown) through LAN 52 or WAN 54.

Adaptation of Deformation Factor for Pose Angularly Offset

FIG. 10 shows a schema of a reference system and camera model for anadaptive process for processing an image in accordance with anembodiment of the invention. Schema 1000 establishes a relationship ofsource point 1001 (x_(n),y_(n),z_(n)) and corresponding projected point1003 (x_(p),y_(p)) on camera image plane 1005. A source image consistsof a collection of source points, and the corresponding camera consistsof a collection of projected points. (In FIG. 10, the source image is animage of a person's head or face. The source image may be an actualobject or a visual representation of the actual object.)

The camera is characterized by optical center 1007 and focal length (F)1009. The axis orientation of the camera is characterized by angles α1011, β 1013, and γ 1015 corresponding to the x, y, and z axes,respectively. The origin of the axis orientation is located at thecenter of the camera image plane of the projected section that is shownin FIG. 10. Projected point 1003 (x_(p),y_(p)) is related to thecorresponding source point 1001 by the following relationship:

$\begin{matrix}{\left( {x_{p},y_{p}} \right) = \left( {\frac{F \cdot x_{n}}{F - z_{n}},\frac{F \cdot y_{n}}{F - z_{n}}} \right)} & \left( {{EQ}.\mspace{14mu} 10} \right)\end{matrix}$where F is the focal length of the camera.

With embodiments of the invention, one may assume that the face of theperson is perpendicular to the axis orientation of the camera. Takinginto account the 3D observation model detailed, as will be discussed, adirect pose occurs when α=β=γ=0.

Embodiments of the invention support image poses in which the pose isangularly offset. The correction factor for such a situation adapts thedeformation factor w applied to the deformation vector of each vertex(e.g., as the vertices shown in FIG. 1) that is moved during thereshaping of the image (e.g., the face of a person). With an embodimentof the invention, the correction factor may be obtained from an angulardisplacement and a translation displacement of the source image from thecamera image. The translation and the displacement may be determinedfrom the difference from the 3D face pose in a frontal position (fromwhich one has previously computed the weights) and the 3D pose of theface that one has actually taken the picture of.

The observation model utilized to relate the head in its neutral pose(source image facing the camera) and its projected representation takinginto account the rigid motion (translations and rotations) of the headobserved from reference origin 1017 and the projection due to thecamera. Although the acquisition camera is not calibrated because onedoes not control the nature of the input sequences, one can stillconsider that it obtains a perspective projection and not an orthogonalprojection.

Reference origin 1017 is situated along the optical axis of the cameraat the center of camera image plane 1005. Camera image plane 1005represents the video image where the face is focused. Focal distance F1009, represents the distance from camera image plane 1005 to theoptical center of the camera. To describe the rigid motion of the head,one may specify three translations, along the X, Y and Z-axes, and threerotations, around the X, Y, and Z axes. FIG. 10 presents the graphicalinterpretation of the model and the orientation of the reference axes.

One may describe points using their homogenous coordinates to be able todescribe a perspective transform linearly and derive the relationshipbetween 3D neutral coordinates and 2D projections.

A vector (x, y, z, o)^(T) corresponds to a homogenous point if at leastone of its elements is not 0. (o is the coordinate that is added toconvert the coordinates to homogenous coordinates. Homogeneouscoordinates allow affine transformations to be easily represented by amatrix. Also, homogeneous coordinates make calculations possible inprojective space just as Cartesian coordinates do in Euclidean space.The homogeneous coordinates of a point of projective space of dimensionn are typically written as (x:y:z: . . . :o), a row vector of lengthn+1, other than (0:0:0: . . . :0)). If a is a real number and is not 0,(x, y, z, o)^(T) and (ax, ay, az, ao)^(T) represent the same homogenouspoint. The relationship between a point in 3D or 2D Euclidean space andits homogenous representation is:

-   -   (x, y, z)_(3D)→(x, y, z,1)_(3D) and (x, y)_(2D)→(x, y,0,1)_(2D)

One can obtain the Euclidean representation of a homogenous point onlyif o≠0:

-   -   (x, y, z, o)_(H)→(x/o, y/o, z/o)_(3D) and (x, y, o)_(H)→(x/o,        y/o)_(2D)

As an example of projective space in three dimensions, there arecorresponding homogeneous coordinates (x:y:z:o). The plane at infinityis typically identified with the set of points with o=0. Away from thisplane, one can denote (x/o, y/o, z/o) as an ordinary Cartesian system;therefore, the affine space complementary to the plane at infinity isassigned coordinates in a similar way, with a basis corresponding to(1:0:0:1), (0:1:0:1), (0:0:1:1).

The following matrices represent different transformations that describerigid motion, where s_(α)=sin(α), c_(α)=cos(α), s_(β)=sin(β),c_(β)=cos(β), s_(γ)=sin(γ), and c_(γ)=cos(γ).

-   -   Translation following vector (t_(X), t_(Y), t_(Z))^(T)

$T_{({t_{X},t_{Y},t_{Z}})} = {\begin{bmatrix}1 & 0 & 0 & t_{X} \\0 & 1 & 0 & t_{Y} \\0 & 0 & 1 & t_{Z} \\0 & 0 & 0 & 1\end{bmatrix}.}$

-   -   Rotation by an angle of α radians around the X-axis:

$R_{\alpha,X} = {\begin{bmatrix}1 & 0 & 0 & 0 \\0 & c_{\alpha} & {- s_{\alpha}} & 0 \\0 & s_{\alpha} & c_{\alpha} & 0 \\0 & 0 & 0 & 1\end{bmatrix}.}$

-   -   Rotation by an angle of β radians around the Y-axis:

$R_{\beta,Y} = {\begin{bmatrix}c_{\beta} & 0 & s_{\beta} & 0 \\0 & 1 & 0 & 0 \\{- s_{\beta}} & 0 & c_{\beta} & 0 \\0 & 0 & 0 & 1\end{bmatrix}.}$

-   -   Rotation by an angle of γ radians around the Z-axis:

$R_{\gamma,Z} = {\begin{bmatrix}c_{\gamma} & {- s_{\gamma}} & 0 & 0 \\s_{\gamma} & c_{\gamma} & 0 & 0 \\0 & 0 & 1 & 0 \\0 & 0 & 0 & 1\end{bmatrix}.}$

The final location of the head regarding reference origin 1017 isobtained applying the translation and rotation matrices upon thecoordinates of the head in its neutral pose.x _(trans) ^(T) =G·x _(n) ^(T)whereG=T _((t) _(X) _(,t) _(Y) _(,t) _(Z)) ·R _(α,x) ·R _(β,y) ·R _(γ,z)

Then, the position “head is facing the camera” is defined when(t_(X),t_(Y),t_(Z))^(T)=(0,0,0) α=0, β=0 and γ=0. The observedprojection on camera image plane 1005 is:x _(p) ^(T) =P _(F) ·T _((0,0,−F)) ·x _(trans) ^(T),where

$\begin{matrix}{{P_{F} \cdot T_{({0,0,{- F}})}} = {\begin{bmatrix}F & 0 & 0 & 0 \\0 & F & 0 & 0 \\0 & 0 & {- 1} & {{- 2}F} \\0 & 0 & {- 1} & 0\end{bmatrix} \cdot \begin{bmatrix}1 & 0 & 0 & 0 \\0 & 1 & 0 & 0 \\0 & 0 & 1 & {- F} \\0 & 0 & 0 & 1\end{bmatrix}}} \\{= \begin{bmatrix}F & 0 & 0 & 0 \\0 & F & 0 & 0 \\0 & 0 & {- 1} & {- F} \\0 & 0 & {- 1} & F\end{bmatrix}}\end{matrix}$represents the complete projection from the combination of theperspective projection matrix, P_(F), whose origin is located on theoptical center of the camera and the translation −F along the Z-axis,and T_((0,0,−F)), which relocates the origin of the reference axis onthe image plane (just as with the observation model shown in FIG. 10).One obtains the following expression to relate the homogenouscoordinates of the points belonging to the head in its neutral pose andtheir observed equivalent representation on camera image plane 1005:

$\begin{bmatrix}x_{p} \\y_{p} \\z_{p} \\o_{p}\end{bmatrix} = {\begin{bmatrix}{{Fc}_{\beta}c_{\gamma}} & {{- {Fc}_{\beta}}s_{\gamma}} & {Fs}_{\beta} & {Ft}_{X} \\{F\left( {{c_{\alpha}s_{\gamma}} + {s_{\alpha}s_{\beta}c_{\gamma}}} \right)} & {F\left( {{c_{\alpha}s_{\gamma}} - {s_{\alpha}s_{\beta}s_{\gamma}}} \right)} & {F\left( {{- s_{\alpha}}c_{\beta}} \right)} & {Ft}_{Y} \\{{c_{\alpha}s_{\beta}c_{\gamma}} - {s_{\alpha}c_{\gamma}}} & {{{- c_{\alpha}}s_{\beta}c_{\gamma}} - {s_{\alpha}c_{\gamma}}} & {{- c_{\alpha}}c_{\beta}} & {{- t_{Z}} - F} \\{{c_{\alpha}s_{\beta}c_{\gamma}} - {s_{\alpha}c_{\gamma}}} & {{{- c_{\alpha}}s_{\beta}c_{\gamma}} - {s_{\alpha}c_{\gamma}}} & {{- c_{\alpha}}c_{\beta}} & {{- t_{Z}} + F}\end{bmatrix} \cdot \begin{bmatrix}x_{n} \\y_{n} \\z_{n} \\o_{n}\end{bmatrix}}$

After transforming the homogenous coordinates to Euclidean spacecoordinates (o=1 and z_(p) is not taken into account), the observation(x_(p), y_(p))_(2D) ^(T) on the image plane of a given point (x_(n),y_(n), z_(n))_(3D) ^(T) belonging to the face in its neutral pose is:

$\begin{bmatrix}x_{p} \\y_{p}\end{bmatrix}_{2D} = {\frac{F}{N}\begin{bmatrix}{{c_{\beta}c_{\gamma}x_{n}} - {c_{\beta}s_{\gamma}y_{n}} + {s_{\beta}z_{n}} + t_{X}} \\\begin{matrix}{{\left( {{s_{\alpha}s_{\beta}c_{\gamma}} + {c_{\alpha}s_{\gamma}}} \right)x_{n}} - {\left( {{s_{\alpha}s_{\beta}s_{\gamma}} + {c_{\alpha}c_{\gamma}}} \right)y_{n}} -} \\{{s_{\alpha}c_{\beta}z_{n}} + t_{Y}}\end{matrix}\end{bmatrix}}$N = (c_(α)s_(β)c_(γ) − s_(α)s_(γ))x_(n) + (−c_(α)s_(β)s_(γ) − s_(α)c_(γ))y_(n) − c_(α)c_(β)z_(n) − t_(z) + F

For each of the vertices i to be moved during the reshaping of the face(referring to FIG. 2) according to the new deformation factor w^(new).w ^(new) _(i=) =w _(i)·(r _(i)(α,β,t _(z))+1)  (EQ. 11)where

$\begin{matrix}{{r_{i}\left( {\alpha,\beta,t_{z}} \right)} = {\left( \frac{{\alpha \cdot \left( {y_{C\; 1} - y_{i}} \right)} + {\beta \cdot \left( {x_{i} - x_{18}} \right)}}{E} \right) + \frac{t_{z}}{G}}} & \left( {{EQ}.\mspace{14mu} 12} \right)\end{matrix}$x_(i) and y_(i) are the 2D coordinates of the vertices on the i^(th)image as the have been determined on the mesh and not on the 3Dobservation model. With embodiments of the invention, x₁₈ and y_(c1)refer to point 218 and point 251, respectively, as shown in FIG. 2. Oneshould note that the Y-axis of the observation model and the Y-axis ofthe reference system for the mesh are inverted; thus, the considerationof one system or the other does change how the adaptation should betreated. E and G are scale values that are determined empirically ineach system that uses this approach. E controls the amount ofdeformation due to the rotations and G controls the influence of thedistance of the person to the camera. Once the “neutral” position of aface on a picture is determined for a concrete instance of the system(neutral meaning α=β=γ=tz=t_(y)=t_(z)=0), E and G are chosen so thatcorrection function r stays within reasonable limits. (For mostimplementations that would be from 0 to 1.) E scales down the units fromthe image vertices coordinates (x,y) and sets how much influence theangles have with respect to the face translation. G scales down theunits from the z-translation on the 3D model used and also sets theinfluence of this parameter in the rectifying factor. For example, Etakes a value of the order of magnitude of the face coordinate units(e.g., (y_(c1)−y_(i)) & (x_(i)−x₁₈) max value=1500,E˜2000*2*3.1415˜12000) and the same applies to G regarding t_(z) (e.g.,t_(z) max value 60, G˜100*2˜200). In the given example, E and G wouldhave approximately equivalent influence accounting for half of theinfluence in the final rectification.

From EQs. 11 and 12, a deformation factor w (e.g., as determined withEQs. 4A-4D) is multiplied by a correction factor r(α,β,t_(z))+1 in orderobtain a new (corrected) deformation factor w^(new). From EQs. 1-5B, acorrected deformation vector is determined. Each deformation vector isapplied to a corresponding vertex to obtain a transformed mesh.Experimental data using EQs. 11-12 have been obtained for angulardisplacement α 1011 varying between ±0.087 radians and angulardisplacement β 1013 varying between ±0.17 radians.

As can be appreciated by one skilled in the art, a computer system(e.g., computer 1 as shown in FIG. 9) with an associatedcomputer-readable medium containing instructions for controlling thecomputer system may be utilized to implement the exemplary embodimentsthat are disclosed herein. The computer system may include at least onecomputer such as a microprocessor, a cluster of microprocessors, amainframe, and networked workstations.

While the invention has been described with respect to specific examplesincluding presently preferred modes of carrying out the invention, thoseskilled in the art will appreciate that there are numerous variationsand permutations of the above described systems and techniques that fallwithin the spirit and scope of the invention as set forth in theappended claims.

1. A method for altering a camera image comprising: locating a pluralityof points on the camera image; generating a mesh from the plurality ofthe points, the mesh being superimposed on the camera image andassociated with corresponding texture information of the camera image;determining compensation information based on a translationaldisplacement or an angular displacement being between a source image andthe camera image, comprising; determining a weight value factor (A), ascale factor (s), a deformation factor (w), and a direction vector({right arrow over (u)}), obtaining a correction factor (r(α,β,t_(z))+1) based on the translation displacement or the angulardisplacement between the source image and the camera image, generating acorrected deformation factor (w^(new))by multiplying the deformationfactor (w) by the correction factor (r(α, β,t_(z))+1), and determining adeformation vector ({right arrow over (v)}_(d)) from a product of theweight value factor (A), the scale factor (s), the corrected deformationfactor (w^(new)), and the direction vector ({right arrow over (u)}); andaltering the camera image by relocating a proper subset of the points onthe camera image by applying the deformation vector ({right arrow over(v)}_(d)) to one or more points of the proper subset of points.
 2. Themethod of claim 1, wherein determining compensation informationcomprises: determining the scale factor, the deformation vector ({rightarrow over (v)}_(d)) being independent of an image size.
 3. The methodof claim 1, wherein determining compensation information comprises:determining the direction vector from a difference between a center andsaid one of the proper subset of points.
 4. The method of claim 1,wherein determining compensation information comprises: determining theweight value factor from a desired amount of fattening or thinning. 5.The method of claim 1, comprising: obtaining matrices corresponding tothe translation and angular displacements; and multiplying the matricesto obtain projected points on the camera image.
 6. The method of claim1, comprising: obtaining a transformed mesh from the mesh; and renderingthe altered image from the transformed mesh and the correspondingtexture information.
 7. The method of claim 1, the camera imageincluding a face of a person and comprising altering the camera image toobtain a desired degree of fattening or thinning for the face of theperson.
 8. A non-transitory computer-readable medium havingcomputer-executable instructions to perform the steps comprising:locating a plurality of points on the camera image; generating a meshfrom the plurality of the points, the mesh being superimposed on thecamera image and associated with corresponding texture information ofthe camera image; determining compensation information based on atranslational displacement or an angular displacement between a sourceimage and the camera image, comprising: determining a weight valuefactor (A), a scale factor (s), a deformation factor (w), and adirection vector ({right arrow over (u)}), obtaining a correction factor(r(α, β,t_(z))+1) based on the translational displacement or the angulardisplacement between the source image and the camera image, generating acorrected deformation factor (w^(new)) by multiplying the deformationfactor (w) by the correction factor (r(α, β,t_(z))+1) , and determininga deformation vector ({right arrow over (v)}_(d)) from a product of theweight value factor (A), the scale factor (s), the corrected deformationfactor (w^(new)), and the direction vector ({right arrow over (u)}); andreshaping the camera image by relocating a proper subset of the pointson the camera image by applying the deformation vector ({right arrowover (v)}_(d)) to one or more points of the proper subset of points. 9.A computer medium of claim 8, having computer-executable instructions toperform the steps comprising: obtaining matrices corresponding to thetranslation and angular displacements; and multiplying the matrices toobtain projected points on the camera image.
 10. The computer medium ofclaim 8, having computer-executable instructions to perform the stepscomprising: obtaining a transformed mesh from the mesh; and renderingthe altered image from the transformed mesh and the correspondingtexture information.
 11. An apparatus for altering a camera image,comprising: an input device configured to obtain a plurality of pointson the camera image; and a processor configured to: locate a pluralityof points on the camera image; generate a mesh from the plurality of thepoints, the mesh being superimposed on the camera image and associatedwith corresponding texture information of the camera image; determinecompensation information based on a translational displacement or anangular displacement between a source image and the camera image,comprising; determining a weight value factor (A), a scale factor (s), adeformation factor (w), and a direction vector ({right arrow over (u)}),obtaining a correction factor (r(α, β,t_(z))+1) based on the translationdisplacement or the angular displacement between the source image andthe camera image, generating a corrected deformation factor (w^(new))bymultiplying the deformation factor (w) by the correction factor (r(α,β,t_(z))+1), and determining a deformation vector ({right arrow over(v)}_(d)) from a product of the weight value factor (A), the scalefactor (s), the corrected deformation factor (w^(new)), and thedirection vector ({right arrow over (u)}); and alter the camera image byrelocating a proper subset of the points on the camera image by applyingthe deformation vector ({right arrow over (v)}_(d)) to one or morepoints of the proper subset of points.
 12. The apparatus of claim 11,wherein the processor is configured to: determine the scale factor, thedeformation vector ({right arrow over (v)}_(d)) being independent of animage size.
 13. The apparatus of claim 11, wherein the processor isconfigured to determine the direction vector from a difference between acenter and said one of the proper subset of points.
 14. The apparatus ofclaim 11, wherein the processor is configured to determine the weightvalue factor from a desired amount of fattening or thinning.
 15. Theapparatus of claim 11, wherein the processor is configured to: obtainmatrices corresponding to the translation and angular displacements; andmultiply the matrices to obtain projected points on the camera image.16. The apparatus of claim 11, wherein the processor is configured to:obtain a transformed mesh from the mesh; and render the altered imagefrom the transformed mesh and the corresponding texture information. 17.The apparatus of claim 11, the camera image including a face of a personand the processor is configured to alter the camera image to obtain adesired degree of fattening or thinning for the face of the person.